home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / misc / halt.lzh / halt / halt_inline.h next >
C/C++ Source or Header  |  1995-10-06  |  2KB  |  98 lines

  1. #ifndef _INLINE_HALT_H
  2. #define _INLINE_HALT_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL 
  11. #define BASE_EXT_DECL0 extern struct Library * HaltBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME HaltBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. static __inline int
  24. Reboot (BASE_PAR_DECL int flags)
  25. {
  26.   BASE_EXT_DECL
  27.   register int _res __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   register int d1 __asm("d1") = flags;
  30.   __asm __volatile ("jsr a6@(-0x1E)"
  31.   : "=r" (_res)
  32.   : "r" (a6), "r" (d1)
  33.   : "a0","a1","d0","d1", "memory");
  34.   return _res;
  35. }
  36. static __inline int
  37. Unmount (BASE_PAR_DECL char *filesystem)
  38. {
  39.   BASE_EXT_DECL
  40.   register int _res __asm("d0");
  41.   register struct Library *a6 __asm("a6") = BASE_NAME;
  42.   register char *d1 __asm("d1") = filesystem;
  43.   __asm __volatile ("jsr a6@(-0x24)"
  44.   : "=r" (_res)
  45.   : "r" (a6), "r" (d1)
  46.   : "a0","a1","d0","d1", "memory");
  47.   return _res;
  48. }
  49. static __inline int
  50. AddShutdownPort (BASE_PAR_DECL struct MsgPort *port)
  51. {
  52.   BASE_EXT_DECL
  53.   register int _res __asm("d0");
  54.   register struct Library *a6 __asm("a6") = BASE_NAME;
  55.   register struct MsgPort *d1 __asm("d1") = port;
  56.   __asm __volatile ("jsr a6@(-0x2A)"
  57.   : "=r" (_res)
  58.   : "r" (a6), "r" (d1)
  59.   : "a0","a1","d0","d1", "memory");
  60.   return _res;
  61. }
  62. static __inline int
  63. RemShutdownPort (BASE_PAR_DECL struct MsgPort *port)
  64. {
  65.   BASE_EXT_DECL
  66.   register int _res __asm("d0");
  67.   register struct Library *a6 __asm("a6") = BASE_NAME;
  68.   register struct MsgPort *d1 __asm("d1") = port;
  69.   __asm __volatile ("jsr a6@(-0x30)"
  70.   : "=r" (_res)
  71.   : "r" (a6), "r" (d1)
  72.   : "a0","a1","d0","d1", "memory");
  73.   return _res;
  74. }
  75. static __inline int
  76. ShutdownStatus (BASE_PAR_DECL struct ShutdownMessage *sm)
  77. {
  78.   BASE_EXT_DECL
  79.   register int _res __asm("d0");
  80.   register struct Library *a6 __asm("a6") = BASE_NAME;
  81.   register struct ShutdownMessage *d1 __asm("d1") = sm;
  82.   __asm __volatile ("jsr a6@(-0x36)"
  83.   : "=r" (_res)
  84.   : "r" (a6), "r" (d1)
  85.   : "a0","a1","d0","d1", "memory");
  86.   return _res;
  87. }
  88.  
  89. #undef BASE_EXT_DECL
  90. #undef BASE_EXT_DECL0
  91. #undef BASE_PAR_DECL
  92. #undef BASE_PAR_DECL0
  93. #undef BASE_NAME
  94.  
  95. __END_DECLS
  96.  
  97. #endif /* INLINE_HALT_H */
  98.